package com.hfi.visitor;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

/**
 * @author ChangLiang
 * @date 2020/4/14
 */
public class App {

    ConstantPool pool = new ConstantPool();

    @BeforeEach
    public void setUp() {
        pool.addConstantInfo(new ClassInfo());
        pool.addConstantInfo(new MethodInfo());
        pool.addConstantInfo(new FieldInfo());
        pool.addConstantInfo(new StringInfo());
    }

    @Test
    @DisplayName("plaintext client")
    public void test() {
        PlainTextVisitor visitor = new PlainTextVisitor();
        pool.getConstantInfos().forEach((info)->info.accept(visitor));
    }


    @Test
    @DisplayName("html client")
    public void test2() {
        HTMLVisitor visitor = new HTMLVisitor();
        pool.getConstantInfos().forEach((info)->info.accept(visitor));
    }


}
